<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo CON_PLATFORMNAME;?>后台管理系统</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="/static/admin/style.css" rel="stylesheet" media="screen" type="text/css" />
<script src="/static/js/jquery.js"></script>
<script src="/static/js/jquery-ui.js"></script>
<link rel="stylesheet" href="/static/css/jquery-ui.css" />
</head>
<?php 
$statusArr = $v['statusArr'];
?>
<body>
<?php include_once 'common/header.php';  ?>
<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once 'common/user_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
	<div class="admin_right_title"><strong>客户管理</strong> / 视频认证</div>
		<div class="admin_right_con" style="width: 98%">
			<table border="0" cellspacing="1" cellpadding="0" bgcolor="#f0f0f0" width="100%">
			  <tr style="color:#636363;">
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>ID</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>用户名</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>状态</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>操作</strong></td>
			  </tr>
			  <?php foreach($list as $info){?>
			  <tr>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $info['user_id'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $info['username'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo isset($statusArr[$info['video_status']]) ? $statusArr[$info['video_status']] : $statusArr['2']; ?> </td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><a href="javascript:checkVideoname(<?php echo $info['video_status']==2?$info['user_id']:0; ?>);"><?php echo $info['video_status']==2?'审核':'--'; ?></a></td>
			  </tr>
			  <?php }?>
			  <tr>
			  	<td colspan="12" align="right" bgcolor="#FFFFFF">
			  		<form action="" method="get">
			  			用户名：<input type="text" id="username" name="username" value="<?php echo $parms['username'];?>" />
			  			状态：<select name="video_status">
			  			<?php foreach($statusArr as $k => $v) { ?>
			  			<option value="<?=$k; ?>" <?php if($parms['video_status']==$k) echo "selected='selected'"; ?>><?php echo $k==0?'全部':$v; ?></option>
			  			<?php } ?>
			  			</select>
			  			<input type="submit"/>
			  		</form>
			  	</td>
			  </tr>
			  <tr>
			  	<td height="35" colspan="12" align="center" class="page" bgcolor="#FFFFFF"><?php echo $this->pagination->create_links();?></td>
			  </tr>
			</table>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<div id="dialog" title="系统提示" style="display:none;">
<div id="msg" style="text-align:center;color:red">&nbsp;</div>
<input type="hidden" name="user_id" id="user_id" />
状态：<input type="radio" name="video_status" checked="checked" value="1"/>审核通过  <input type="radio" name="video_status" value="0"/>审核不通过 <br />
积分：<input type="text" id="jifen" name="jifen" value="<?php echo $jifen;?>"/><br />
备注：<textarea  id="remark" name="remark" style="width: 300px;height: 80px;">视频认证审核通过</textarea><br />
<div style="text-align:center;">
<input type="button" value="关闭" onclick="$('#dialog').dialog('close');"/>
<input type="button" value="提交" onclick="changeVideo();" />
</div>
</div>
<script>
function checkVideoname(userid){
	if(userid>0){
		$( "#dialog" ).dialog({
			height:250,
			width:500,
			modal:true, //蒙层（弹出会影响页面大小）
			title:'视频认证'
		});
		$( "#user_id" ).val(userid);
	}
}

function changeVideo(){
	$.ajax({
			type: "POST",
			url: "/ychadmin/user/attestation_video",
			data: "user_id="+$('#user_id').val()+"&video_status="+$(':radio:checked').val()+"&jifen="+$('#jifen').val()+"&remark="+$('#remark').val(),
			success: function(msg){
		        $( "#dialog" ).dialog();
				$("#msg").html(msg);
				setTimeout(function(){
					$("#msg").html("&nbsp;");
					if(msg=='操作成功'){
						location.reload();
					}
				},3000);
			},
			dataType: "text"
		});
}

$("input[name='video_status']").bind("click", function(){
	var _fstatus = $("input[name='video_status']:checked").val();		
	if(_fstatus == 0){
		$( "#remark" ).val('视频认证审核不通过');
	}else{
		$( "#remark" ).val('视频认证审核通过');
	}
});

</script>
</body>
</html>
